<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    	<title>退货单详情</title>
    <!--{include file='comm/comm_pic.tpl'}-->
</head>

<body>
<div class="form-horizontal" style="margin: 10px 10px 60px 10px;">

    <div class="title">
        <h2 class="tac">
            退货单详情
        </h2>
    </div>

    <!--订单信息-->
    <div class="panel panel-default">
        <h2 class="panel-heading">
            订单信息
        </h2>
        <div class="items2">
            <form id="return_form" name="return_form" onsubmit="return false;">
            <table style="width: 98%;margin: 0 auto;padding-bottom: 6px;">
                <tbody>
                <tr>
                    <td class="tar" style="width: 10%">创建日期：</td>
                    <td style="width: 23%">
                        <!--{$return_info.createTime}-->
                        <input type="hidden" value="<!--{$return_info.createTime}-->" name="bill_no">
                    </td>
                    <td class="tar" style="width: 10%"><!--{$name}-->单状态：</td>
                    <td style="width: 23%">
                        <!--{if $return_info.return_status == 1}-->
                        未审核
                        <!--{elseif $return_info.return_status == 2}-->
                        已审核
                        <!--{elseif $return_info.return_status == 3}-->
                        取消
                        <!--{/if}-->
                    </td>
                    <td class="tar" style="width: 10%"><!--{$name}-->原因：</td>
                    <td style="width: 23%">
                        <!--{$return_info.return_reason}-->
                    </td>
                </tr>
                <tr>
                    <td class="tar"><!--{$name}-->人：</td>
                    <td><!--{$return_info.deliver_name}--></td>
                    <td class="tar">手机：</td>
                    <td><!--{$return_info.deliver_mobile}--></td>
                    <td class="tar">电话：</td>
                    <td><!--{$return_info.deliver_phone}--></td>
                </tr>
                <tr style="height: 30px;line-height: 30px;">
                    <td class="tar"><!--{$name}-->地址：</td>
                    <td colspan="5" >
                        <!--{$return_info.deliver_province}--> <!--{$return_info.deliver_city}--> <!--{$return_info.deliver_county}--> <!--{$return_info.deliver_address}-->
                    </td>
                </tr>
                <tr >
                    <td class="tar">备注：</td>
                    <td colspan="5">
                        <!--{$return_info.return_memo}-->
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>



    <!--商品信息-->
    <div class="panel panel-default">
        <h2 class="panel-heading">
            商品信息
        </h2>
        <div class="items2">
            <table style="width: 100%;margin: 0 auto 8px;" class="s" id="goods_table">
                <thead>
                <tr>
                    <th style="width: 15%;padding: 0;">商品号</th>
                    <th style="padding: 0;">商品名称</th>
                    <th style="width: 20%;padding: 0;">规格</th>
                    <th style="width: 10%;padding: 0;">数量</th>
                </tr>
                </thead>

                <tbody>
                <!--{foreach from=$goods_array item=goods}-->
                <tr>
                    <td style="text-align: center;"><!--{$goods.goodsID}--></td>
                    <td class="tal">
                        <!--{$goods.goodsName}-->
                    </td>
                    <td ><!--{$goods.spec}--></td>
                    <td style="text-align: center;">
                        <!--{$goods.goods_amount}-->
                    </td>
                </tr>
                <!--{/foreach}-->
                </tbody>
            </table>
            </form>
        </div>
    </div>

    <div></div>


    <div class="bottom_fixbox">
        <div class="rectbox tac" style="position: relative;">
            <!--{if $return_info.return_status == 1}-->
            <input type="button" class="btn" onclick="bill.audit();" value="审核" />&nbsp;&nbsp;&nbsp;
            <input type="button" class="btn" onclick="bill.cancel();" value="取消" />&nbsp;&nbsp;&nbsp;
            <!--{/if}-->
            <input type="button" class="btn" onclick="E.closeWindows();" value="关闭"  />
           <div style="position: absolute;right:50px;top:0px;">
               <span><!--{$name}-->金额：</span>
               <span class="red" id="return_prices" ><!--{$return_info.return_price}--></span>
               &nbsp;
               <span><!--{$name}-->数量：</span>
               <span class="red" id="return_amounts" ><!--{$return_info.return_amount}--></span>
           </div>
        </div>


    </div>

</div>
<script language="JavaScript" src="/quanliadmin/docroot/js/region.js" type="text/javascript"></script>

<script>




var bill = {

    audit : function (){
        E.confirm("是否确认审核该<!--{$name}-->单？","bill.confirmAudit");
    },

    confirmAudit : function (){

        this.action = 2;

        var dt = {
            return_no : "<!--{$return_info.return_no}-->"
        }

        E.ajax_post({
            url : "/invokingAjax-backend/bill/billReturn.ajax?operFlg=3",
            data : dt,
            call : "bill.result"
        });
    },

    cancel : function (){
        E.confirm("是否确认取消该<!--{$name}-->单？","bill.confirmCancel");
    },

    confirmCancel : function (){

        this.action = 3;

        var dt = {
            return_no : "<!--{$return_info.return_no}-->"
        }

        E.ajax_post({
            url : "/invokingAjax-backend/bill/billReturn.ajax?operFlg=4",
            data : dt,
            call : "bill.result"
        });
    },

    result : function (response){

        if(response.code != 200){
            E.alert(response.message);
            return false;
        }

        E.opener("bill.search");

        if(this.action == 2){
            E.alert("审核成功",2,"E.closeWindows");
        }else{
            E.alert("取消成功",2,"E.closeWindows");
        }

    }


}




</script>
</body>
</html>
